package com.ticket.system.service;

import java.math.BigDecimal;
import java.util.List;

import com.github.binarywang.wxpay.exception.WxPayException;
import com.ticket.system.domain.YanchuOrder;
import com.ticket.system.domain.YanchuRefundOrder;
import com.ticket.system.domain.YanchuSession;
import com.ticket.system.domain.vo.CancelTicketStatVo;
import com.ticket.system.domain.vo.OrderVo;
import com.ticket.system.domain.vo.RefundOrderVo;

import javax.servlet.http.HttpServletResponse;

/**
 * 退款单Service接口
 * 
 * @author ruoyi
 * @date 2023-10-31
 */
public interface IYanchuRefundOrderService 
{
    /**
     * 查询退款单
     * 
     * @param id 退款单主键
     * @return 退款单
     */
    public YanchuRefundOrder selectYanchuRefundOrderById(Long id);

    /**
     * 查询退款单列表
     * 
     * @param yanchuRefundOrder 退款单
     * @return 退款单集合
     */
    public List<RefundOrderVo> selectYanchuRefundOrderList(YanchuRefundOrder yanchuRefundOrder);

    /**
     * 新增退款单
     * 
     * @param yanchuRefundOrder 退款单
     * @return 结果
     */
    public int insertYanchuRefundOrder(YanchuRefundOrder yanchuRefundOrder,YanchuSession session) throws WxPayException;

    /**
     * 修改退款单
     * 
     * @param yanchuRefundOrder 退款单
     * @return 结果
     */
    public int updateYanchuRefundOrder(YanchuRefundOrder yanchuRefundOrder);

    /**
     * 批量删除退款单
     * 
     * @param ids 需要删除的退款单主键集合
     * @return 结果
     */
    public int deleteYanchuRefundOrderByIds(Long[] ids);

    /**
     * 删除退款单信息
     * 
     * @param id 退款单主键
     * @return 结果
     */
    public int deleteYanchuRefundOrderById(Long id);

    public Integer cancelOrderList(YanchuOrder yanchuOrder, String reason, Long userId, YanchuSession session);

    public int cancelOrder(YanchuOrder yanchuOrder,YanchuRefundOrder yanchuRefundOrder,YanchuSession session,List<Long> idList) throws WxPayException;

    public int cancelOrderNotify(String outTradeNo,String refundNo,BigDecimal refundFee);

    public int cancelTicketOrderNotify(String outRefundNo, BigDecimal refundFee);

    public YanchuRefundOrder selectRefundPayByRefundNo(String refundNo) throws WxPayException;

    public int cancelTicketOrder(YanchuRefundOrder refundOrder,YanchuOrder yanchuOrder,List<Long> detailIds,YanchuSession session) throws WxPayException;

    public CancelTicketStatVo cancelTicketStat(Long sessionId);

    public RefundOrderVo selectRefundOrderVoById(Long id);

    public RefundOrderVo selectRefundOrderVoByDetailId(Long id);

    public void notifyUserCancel(OrderVo vo);

    void exportRefundOrderList(HttpServletResponse response, YanchuRefundOrder yanchuRefundOrder);

    Integer getExportCount(YanchuRefundOrder yanchuRefundOrder);
}
